<?php

/**
 * 用户签证
 * @author Administrator
 *
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class MakerApply extends Model {

    protected $table = 'maker_apply';
    protected $guarded = array();
    protected $fillable = array('name', 'maker_type', 'zone_id', 'uid', 'role_apply_id');
    public $timestamps = false;
    private static $STATUS_LISTS = [
        "fuhuaqi" => '孵化器',
        "maker" => '创业空间',
        "coffee" => '创客咖啡',
        "factory" => '创新工场',
        "media" => '科技媒体',
        "qita" => '其他',
    ];

    public function apply() {
        return $this->hasOne(RoleApply::class, 'id', 'role_apply_id');
    }

    //创客空间类型
    public function typeName() {
        return array_get(self::$STATUS_LISTS, $this->maker_type, '');
    }

    //创客空间类型
    public function zone() {
        return $this->hasOne(Zone::class, 'id', 'zone_id');
    }

}
